<?
$r = "../";
require_once($r."_engine/header_nocache.php");

include "profile_process.php";

require_once($r."_engine/c_countries.php");
require_once($r."_inc/text.php");

$p = "profile";
include $r."_header.php";
?>

<?
check_and_show_error(@$status == UPDATE_PROFILE_INCORRECT_PASSWORD,		$g_text_incorrect_old_password);
check_and_show_error(@$status == UPDATE_PROFILE_INCORRECT_PASSWORD2,	$g_text_incorrect_password2);
?>
<script src="/js/_global.js"></script>


<form action="<?=$PHP_SELF?>" method="post" name="form_profile" id="form_profile">
<input type="Hidden" name="do_update" value="1">

<table cellspacing="5" cellpadding="0" style="margin-left: 5;">
<tr>
	<td colspan="2" class="tdH">General</td>
</tr>
<tr>
	<td><span class="text">Your Name:</span></td>
	<td><span class="textStd"><input type="Text" name="f_first_name" value="<?=htmlspecialchars(@$account->data["first_name"])?>" style="width:230"
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Your Last Name:</span></td>
	<td><span class="textStd"><input type="Text" name="f_last_name" value="<?=htmlspecialchars(@$account->data["last_name"])?>" style="width:230"
		class="input2" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Your Email:</span></td>
	<td><span class="textStd"><input type="Text" name="f_email" value="<?=htmlspecialchars(@$account->data["email"])?>" style="width:230"
		class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>

<tr>
	<td><span class="text">Mobile Phone:</span></td>
	<td><span class="textStd">
		<table width="100%" border="0" cellpadding="0" cellspacing="2" class="text_small">
          <tr>
            <td width="55" valign="bottom" style="font-size: 8pt">Country<br>Code</td>
            <td valign="bottom" style="font-size: 8pt">Prefix and Number<br>(no leading "0", no spaces)</td>
            <td valign="middle" style="font-size: 9pt"><a href="Javascript:openwin('/images/phone_format.gif',380,100)">Mobile number example</a></td>
          </tr>
          <tr>
		  	<td>
		    <input type="text" name="f_mobile_code" id="f_mobile_code" size="3" maxlength="4" style="width: 50" value="<?=htmlspecialchars(@$account->data["mobile_code"])?>" style="width:230"
class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'">
		    </td>
		    <td>
			<input type="text" name="f_mobile_number" id="f_mobile_number" size="16" maxlength="20" style="width: 170; margin-right: 5px" value="<?=htmlspecialchars(@$account->data["mobile_number"])?>" style="width:230"
class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'">
		    </td>
		    <td>
			<input type="button" value="Send Test SMS" onClick="sendTestSMS();" style="font-size: 10pt; width: 100%" class="button2" onMouseOver="this.className='button2_act'" onMouseOut="this.className='button2'">
		    </td>
		  </tr>
		  <script type="text/javascript" language="JavaScript">
			function sendTestSMS()
			{
				var f = document.form_profile;				var sms_url = "<? echo $sms_sender_url; ?>?number="+f.f_mobile_code.value+f.f_mobile_number.value;

				if (f.f_mobile_code.value=="" || f.f_mobile_number.value=="") {					alert('<? echo $g_text_test_sms_empty; ?>') ;					return false;
				}

				var s =
					'<table cellspacing="10" cellpadding="0">'+
					'<tr>'+
					'<td><img src="../images/throbber.gif" width="39" height="39" alt="" border="0"></td>'+
					'<td><p class="text" id="tm_action_text">Loading...</td>'+
					'</tr>'+
					'</table>';
				document.getElementById("sms_status").innerHTML = s;

				var f = document.form_def;
				ajaxLoadDataToInnerHtml(
					sms_url,
					"sms_status");
			}

		</script>
		   <tr>
            <td colspan="3"><span id="sms_status"></span></td>
          </tr>
        </table>
	</span></td>
</tr>





<tr><td colspan="2">&nbsp;</td></tr>
<tr>
	<td colspan="2" class="tdH">Contact Details</td>
</tr>
<tr>
	<td><span class="text">Country:</td>
	<td><span class="textStd"><select name="f_user_country" class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'" style="width:230">
		<option value="">Select...</options>
		<? html_options_from_list($g_countries->GetList(), @$account->data["user_country"]); ?>
		</select>
	</td>
</tr>
<tr>
	<td><span class="text">Street Address1:</td>
	<td><span class="textStd"><input type="Text" name="f_user_addr1" value="<?=htmlspecialchars(@$account->data["user_addr1"])?>"
			class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'" style="width:230">
	</td>
</tr>
<tr>
	<td><span class="text">Street Address2:</td>
	<td><span class="textStd"><input type="Text" name="f_user_addr2" value="<?=htmlspecialchars(@$account->data["user_addr2"])?>"
			class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'" style="width:230">
	</td>
</tr>
<tr>
	<td><span class="text">City:</td>
	<td><span class="textStd"><input type="Text" name="f_user_city" value="<?=htmlspecialchars(@$account->data["user_city"])?>"
			class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'" style="width:230">
	</td>
</tr>
<tr>
	<td><span class="text">State/Province:</td>
	<td><span class="textStd"><input type="Text" name="f_user_state" value="<?=htmlspecialchars(@$account->data["user_state"])?>"
			class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'" style="width:230">
	</td>
</tr>
<tr>
	<td><span class="text">Zip/Postal Code:</td>
	<td><span class="textStd"><input type="Text" name="f_user_zip" value="<?=htmlspecialchars(@$account->data["user_zip"])?>"
			class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'" style="width:230">
	</td>
</tr>
<tr>
	<td><span class="text">Phone:</td>
	<td><span class="textStd"><input type="Text" name="f_user_phone" value="<?=htmlspecialchars(@$account->data["user_phone"])?>"
			class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'" style="width:230">
	</td>
</tr>


<tr><td colspan="2">&nbsp;</td></tr>
<tr>
	<td colspan="2" class="tdH">Password (fill only to change password)</td>
</tr>
<tr>
	<td><span class="text">Old Password:</span></td>
	<td><span class="textStd"><input type="Password" name="f_password_old" value="<?=htmlspecialchars(@$f_password_old)?>" style="width:230"
		class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Password:</span></td>
	<td><span class="textStd"><input type="Password" name="f_password" value="<?=htmlspecialchars(@$f_password)?>" style="width:230"
		class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>
<tr>
	<td><span class="text">Re-enter Password:</span></td>
	<td><span class="textStd"><input type="Password" name="f_password2" value="<?=htmlspecialchars(@$f_password2)?>" style="width:230"
		class="input2" onFocus="this.className='input2_act'" onBlur="this.className='input2'"></span></td>
</tr>


<tr><td colspan="2">&nbsp;</td></tr>
<tr>
    <td></td>
	<td><span class="textStd">
		<input type="Submit" value="Save" style="width: 150;" class="button2" onMouseOver="this.className='button2_act'" onMouseOut="this.className='button2'">
	</td>
</tr>
</table>
</form>



<?
include $r."_footer.php";

//phpinfo();
?>